<script setup>
import { ref } from 'vue'
import ActivityGoods from './../home_activity_goods'

const visible = ref(false)
const data = ref()

const open = (value) => {
    data.value = value
    visible.value = true
}

const close = () => {
    visible.value = false
    data.value = {}
}

//把方法暴露给父组件
defineExpose({
    open
})
</script>
    
    <template>
    <el-dialog v-model="visible" title="详情" center @close="close" destroy-on-close width="70%" top="10vh">
        <activity-goods v-if="data" :home-id="data.id"/>
    </el-dialog>
</template>
    
<style lang="scss" scoped>
:deep(.el-dialog__body) {
    padding: 15px;
}
</style>